package demo1;

import javax.swing.plaf.synth.SynthOptionPaneUI;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-18
 * Time: 10:30
 */
public class OutClass {
    public int a1 = 1;
    private int a2 = 2;
    public static int a3 = 3;
    static class InnerClass{
        public int a4 = 4;
        private int a5 = 5;
        public static int a6 = 6;
        public void test(){
            //只能调用静态成员
            //System.out.println(a1);
            System.out.println(a3);
            OutClass outClass = new OutClass();
            System.out.println(outClass.a1);
            System.out.println(outClass.a2);
            System.out.println(outClass.a3);
            System.out.println("static内部类的test方法执行了");
        }

        }
    class InnerClass2{
        public int a4 = 4;
        private int a5 = 5;
        public static int a6 = 6;
        public void test(){
            System.out.println(a4);
            System.out.println(a5);
            System.out.println(a6);
            System.out.println("非静态内部类执行了");
        }
    }
}
